#pragma once 
#include <string> 
#include <cstddef> 
#include <memory>
#include <odb/nullable.hxx>
#include <odb/core.hxx>

namespace zhiang {

#pragma db object table("music")
class Music {
public:
    Music() {}
    Music(const std::string& music_id,  
        const std::string& time,
        const std::string& title,
        const std::string& author) :
        _music_id(music_id), _time(time), _author(author), _title(title) {}

    std::string music_id() { return _music_id; }
    void music_id(const std::string& val) {  _music_id = val; }

    std::string time() { return _time; }
    void time(const std::string& val) {  _time = val; }

    std::string title() { return _title; }
    void title(const std::string& val) {  _title = val; }

    std::string author() { return _author; }
    void author(const std::string& val) {  _author = val; }


private:
    friend class odb::access;
    #pragma db id auto
    unsigned int _id;
    #pragma db type("varchar(64)") index unique
    std::string _music_id;
    #pragma db type("varchar(64)") 
    std::string _time;
    #pragma db type("varchar(128)") 
    std::string _title;
    #pragma db type("varchar(64)") 
    std::string _author;
};

}